<template>
  <div class="search-song-Lists">
    <content-list :contentList="albumDatas"></content-list>
  </div>
</template>
<script>
import ContentList from '../ContentList';
import {getSongListOfLikeTitle} from '../../api/index';
import {mixin} from "../../mixins";

export default {
    name: 'search-song-lists',
    mixins: [mixin],
    components:{
      ContentList
    },
    data(){
      return{
        albumDatas: []
      }
    },
    mounted(){
      this.getSearchList();
    },
    methods:{
      getSearchList(){
        let _this = this;
        if(!_this.$route.query.keywords){
            _this.notify('您输入的内容为空','warning')
        } 
        else {
          getSongListOfLikeTitle(this.$route.query.keywords)
          .then(res =>{
            if(res.length != 0){
              this.albumDatas = res
            }else{
              _this.notify('暂无该歌单内容','warning')
            }
          })
        }
      }
    }
}
</script>

<style lang="scss" scoped>
@import '../../assets/css/search-song-lists.scss';
</style>